<%@ taglib uri="/tld/extremecomponents" prefix="ec" %>
<%@taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core" %>
<%@ page language="java" contentType="text/html; charset=utf-8"
    pageEncoding="utf-8"%>
<%@ taglib uri="http://java.sun.com/jsp/jstl/fmt" prefix="fmt" %> 
<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<html>
<head>
	<meta http-equiv="Content-Type" content="text/html; charset=utf-8">

	<script src = "../js/jquery-1.12.1.js" type = "text/javascript"></script>
	<script src = "../js/jquery.validate.js" type = "text/javascript"></script>
	<script src = "../js/messages_zh.js" type = "text/javascript"></script>
	<script src = "../js/common.js" type = "text/javascript"></script>
	
	<link href="<%=request.getContextPath() %>/css/extremecomponents.css" rel="stylesheet" type="text/css" />
	<link href="<%=request.getContextPath() %>/css/global.css" rel="stylesheet" type="text/css" />
	<title></title>
	
</head>
<body>
 <c:choose>
	    <c:when test="${CONDITIONMAP.flag == 'add'}">
   			<div id="current">当前位置： &gt; 新建任务</div>
	    </c:when>
	    <c:when test="${CONDITIONMAP.flag == 'update'}">
   			<div id="current">当前位置：&gt; 修改任务</div>
	    </c:when>
    </c:choose>

    <form id="addCourseForm" name="addCourseForm" method="post">
        <table width="600" height="10" border="0" align="center" cellpadding="0" cellspacing="0">
            <tr>
                <td height="30" align="center" class="xxpage">
                	<table width="100%" border="0" align="center" cellpadding="0" cellspacing="0">
                	 <tr>
                            <td width="14%" class="xxpage_td2">当前用户：</td>
                            <td width="86%" class="xxpage_td2">
                              	<input name="userName" id="userName" type="text"  value="${USERINFO.userCode}"   readonly="true" />
                            	<input type="hidden" name="FLAG" value="<c:out value="${CONDITIONMAP.flag}"/>" />
                            </td>
                        </tr> 
                         <tr>
                            <td class="xxpage_td2">班级：</td>
                            <td class="xxpage_td2">
                            	<input name="CLASS_NAME" id="CLASS_NAME" type="text" value="<c:out value='${CONDITIONMAP.CLASS_NAME}'/>"  />
                            </td>
                        </tr>
                         <tr>
                            <td class="xxpage_td2">班级号：</td>
                            <td class="xxpage_td2">
                            	<input name="CLASS_ID" id="CLASS_ID" type="text" value="<c:out value='${CONDITIONMAP.CLASS_ID}'/>"  />
                            </td>
                        </tr>
                        <tr>
                            <td class="xxpage_td2">课程名：</td>
                            <td class="xxpage_td2">
                            	<input name="COURSE_NAME" id="COURSE_NAME" type="text" value="<c:out value='${CONDITIONMAP.COURSE_NAME}'/>"  />
                            </td>
                        </tr>
                        <tr>
                            <td class="xxpage_td2">课程号：</td>
                            <td class="xxpage_td2">
                            	<input name="COURSE_ID" id="COURSE_ID" type="text" value="<c:out value='${CONDITIONMAP.COURSE_ID}'/>"  />
                            </td>
                        </tr>
                    </table>
                 </td>
            </tr>
        </table>
        <table width="100%" border="0" cellpadding="0" cellspacing="0">
            <tr>
                <td width="49%" height="40" align="right"><input id="btnadd" name="btnadd" type="button" class="btn_2" value="确认" /></td>
                <td width="2%" align="center">&nbsp;</td>
                <td align="left"><input id="reset" name="reset" type="reset" class="btn_2" value="重置" /></td>
            </tr>
        </table>
    </form>
<script>


//增加/修改
	$("#btnadd").click(function() {
		var COURSE_TEACHERID = $("#COURSE_TEACHERID").val();
		var COURSE_NAME = $("#COURSE_NAME").val();
		var CLASS_NAME=$("#CLASS_NAME").val();
	    if(COURSE_NAME==null || COURSE_NAME=="" || COURSE_NAME==''){
	        alert("课程名不可为空！");
	        return false;
	    }else{
	        $.ajax({
	            type : "post",
	            dataType : "text",
	            url : "login?ActionType=course_Add",
	            data : $("#addCourseForm").serialize(),
	            success : function(massage) {
	                if (massage == 'success') {
	                	goTo("login?ActionType=course_selectInit");
	                }
	                if (massage == 'fail') {
	                	alert("该任务已经存在！");
	                }
	            }
	        });
	    }
	 });
</script>
</body>
</html>